From: Randy Taylor Date: Sun, 16 Feb 2025 20:51:43 +0000 (-0500) Subject: Fix go-ts-mode const_spec highlighting (Bug#76330) X-Git-Tag: archive/raspbian/1%30.2+1-2+rpi1^2~2^2~24^2~247 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/success/%22http:/www.example.com/cgi/success?a=commitdiff_plain;h=b531bbf73ef91aca0a699ffc89e6b93dc49d0151;p=emacs.git Fix go-ts-mode const_spec highlighting (Bug#76330) * lisp/progmodes/go-ts-mode.el (go-ts-mode--font-lock-settings): Handle multiple const_spec identifiers. * test/lisp/progmodes/go-ts-mode-resources/font-lock.go: Add test case. --- diff --git a/lisp/progmodes/go-ts-mode.el b/lisp/progmodes/go-ts-mode.el index 5110ab890f3..eb5b93008eb 100644 --- a/lisp/progmodes/go-ts-mode.el +++ b/lisp/progmodes/go-ts-mode.el @@ -154,7 +154,8 @@ ,@(when (go-ts-mode--iota-query-supported-p) '((iota) @font-lock-constant-face)) (const_declaration - (const_spec name: (identifier) @font-lock-constant-face))) + (const_spec name: (identifier) @font-lock-constant-face + ("," name: (identifier) @font-lock-constant-face)*))) :language 'go :feature 'delimiter diff --git a/test/lisp/progmodes/go-ts-mode-resources/font-lock.go b/test/lisp/progmodes/go-ts-mode-resources/font-lock.go index 4e7a8e1710b..170bf9353c6 100644 --- a/test/lisp/progmodes/go-ts-mode-resources/font-lock.go +++ b/test/lisp/progmodes/go-ts-mode-resources/font-lock.go @@ -3,3 +3,9 @@ for idx, val := range arr {} // ^ font-lock-variable-name-face for idx := 0; idx < n; idx++ {} // ^ font-lock-variable-name-face + +const ( + zero, one = 0, 1 +// ^ font-lock-constant-face +// ^ font-lock-constant-face +)